﻿using System.Collections.Generic;
using Baby.Growup.Api.Model.Weixin;
using Baby.Growup.Common;
using Newtonsoft.Json;

namespace Baby.Growup.Api.Response.Weixin.AccessToken
{
    public class AccessTokenGetResponse : BaseResponse
    {
        public WeixinAccessToken AccessToken { get; set; }

        public override void Paseer()
        {
            IDictionary<string, string> dict = JsonConvert.DeserializeObject<IDictionary<string, string>>(Body);
            AccessToken = new WeixinAccessToken();
            AccessToken.AccessToken = dict["access_token"];
            AccessToken.ExpiresIn = dict["expires_in"].ToLong();
        }
    }
}
